package com.hokook.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>首页控制器</p>
 *
 * @author Jon
 */
@Slf4j
@RestController
public class IndexController {

    @RequestMapping("/")
    public String index(HttpServletRequest request, HttpServletResponse response) {
        Cookie cookie = new Cookie("user-info", request.getSession().getId());
        response.addCookie(cookie);
        return "index";
    }

    @PostConstruct
    public void id() {

    }

}
